﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="E1_eMart.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainBody" runat="server">
    <ul id="login">
    <%
        if (Session["username"] == null)
    {
    %>    
        <li><a href="register.aspx">Register</a></li>
        <li><a href="Login.aspx">Sign in</a></li>  
    <%}
    else
    {%>
    <li>Hello, 
    <%if (loaiTaiKhoan == 1)
      { %>
        <a href="user/Account_Management.aspx">
            <% =gTaiKhoan.TenTaiKhoan%> 
        </a>
        <%}
      else
      { %>
      <a href="">
            <% =gTaiKhoan.TenTaiKhoan%> 
        </a>
        <%} %>
    </li>
    <li>
        <asp:LinkButton ID="lbLogOut" runat="server" 
            onclientclick="if(!confirm('Bạn có muốn thoát không?'))return false" 
            PostBackUrl="~/Logout.aspx">Logout</asp:LinkButton>       
    <%}%>
     </ul>

<div id="left_content">
        <div id="categories">
            <ul>
                <li><a href="/index.aspx">All Categories</a></li>
            <%
                foreach (E1_eMart.LoaiSanPham lsp in lsplist)
                {
            %>
                
                <li><a href="/index.aspx?catid=<%= lsp.MaLoaiSanPham%>"><%= lsp.TenLoaiSanPham%></a></li>

            <% }%>
            </ul>
        </div>
        <div id="guide">
            <h3>Welcome!</h3>
            <p>Whether you're new to eMart or a veteran user, we have just the right tools to get you on the right track.</p>
            <ul>
                <li><img src="images/arrow.gif" alt="arrow"> <a href="sitemap.htm">How to Buy?</a></li>
                <li><img src="images/arrow.gif" alt="arrow"> <a href="sitemap.htm">How to Sell?</a></li>
                <li><img src="images/arrow.gif" alt="arrow"> <a href="sitemap.htm">How to Pay?</a></li>
                <li><img src="images/arrow.gif" alt="arrow"> <a href="sitemap.htm">Security Policy?</a></li>
            </ul>
        </div>
    </div>

    <div id="center_content">
        <div id="products">
            
               <%
                   foreach(E1_eMart.SanPham sp in splist)                  
                {
                            
                %>
                <div class="item">
                    <a href="/product_detail.aspx?id=<%= sp.MaSanPham %>"><img src=<%=  sp.Imglink%> width="100"/></a>
                    <h5><a href="/product_detail.aspx?id=<%= sp.MaSanPham %>"><%=  sp.TenSanPham%><br/>Price: <%= sp.GiaHienTai %>$</a></h5>
                </div>
                <%} %>
            
        </div>
        <div class="clear"></div>
        <div class="clear"></div>
        <div id="page_number" style="text-align: center">
            <%
                if (totalpage > 1)
                {
                    for (int index = 1; index <= totalpage; index++)
                    {
            %>
            <a href="index.aspx?catid=<%= catID%>&page=<%= index%>"><%= index%></a>
            <%      }
                }%>
        </div>
        <div id="shopping_trends">
            <p id="title" style="font-weight:bold;">
                Shopping Trends
            </p>
            <div class="trend">
                <h3><a href="#">HiTech & Computer</a></h3>
                <p>
                    <a href="#">MacBook Pro</a>,
                    <a href="#">Lenovo</a>,
                    <a href="#">laptop touch panel computer</a>,
                    <a href="#">Sony Vaio</a>,
                    <a href="#">Asus</a>,
                    <a href="#">Samsung</a>,
                    <a href="#">Wireless Mouse</a>,
                    <a href="#">HP</a>,
                    <a href="#">Digital Pen</a>...
                </p>
            </div>
            <div class="trend">
                <h3><a href="#">Mobile phones & PDAs</a></h3>
                <p>
                    <a href="#">Iphone 4</a>,
                    <a href="#">Nokia 8800</a>,
                    <a href="#">iPhone 3GS</a>,
                    <a href="#">Blackberry Bold</a>,
                    <a href="#">HTC magic</a>,
                    <a href="#">Nokia C3</a>,
                    <a href="#">Epic 4G Samsung</a>,
                    <a href="#">Motorola Droid X</a>...
                </p>
            </div>
            <div class="trend">
                <h3><a href="#">Camcorders & cameras</a></h3>
                <p>
                    <a href="#">Nikon D200</a>,
                    <a href="#">Canon EOS 7D</a>,
                    <a href="#">Kingston Digital</a>,
                    <a href="#">olympus E-5</a>,
                    <a href="#">Kodak</a>,
                    <a href="#">Sony Handycam</a>,
                    <a href="#">Flip Ultra</a>,
                    <a href="#">Cybershot DSC</a>...
                </p>
            </div>
            <div class="trend">
                <h3><a href="#">Fashion & beauty</a></h3>
                <p>
                    <a href="#">Louis Vuitton</a>,
                    <a href="#">Levis</a>,
                    <a href="#">Adidas</a>,
                    <a href="#">Ralphlauren</a>,
                    <a href="#">Nike</a>,
                    <a href="#">Men's Clothing</a>,
                    <a href="#">Women's Clothing</a>,
                    <a href="#">Bags & For Women</a>,
                    <a href="#">Girls Clothing</a>...
                </p>
            </div>
            <div class="trend">
                <h3><a href="#">Cars & motorbikes</a></h3>
                <p>
                    <a href="#">230 Mercedes</a>,
                    <a href="#">Honda S2000</a>,
                    <a href="#">large cylinder bikes</a>,
                    <a href="#">Toyota Supra</a>,
                    <a href="#">trucks</a>,
                    <a href="#">Yamaha</a>,
                    <a href="#">motorcycle parts</a>,
                    <a href="#">automobile spare parts</a>...
                </p>
            </div>
            <div class="trend">
                <h3><a href="#">Books - Gifts - Toys</a></h3>
                <p>
                    <a href="#">Harry Potter</a>,
                    <a href="#">Book 007</a>,
                    <a href="#">detective stories</a>,
                    <a href="#">teddy bears</a>,
                    <a href="#">dolls prince</a>,
                    <a href="#">princess dolls</a>,
                    <a href="#">educational games</a>,
                    <a href="#">game model</a>...
                </p>
            </div>
        </div>
    </div>

    <div id="right_content">
        <div id="news">
            <h3>Breaking News</h3>
            <div class="item">
                <a href="/product_detail.aspx?id=<%= topsplist[0].MaSanPham %>"><img src="<%= topsplist[0].Imglink%>" height="50"></a>
                <h5><a href="/product_detail.aspx?id=<%= topsplist[0].MaSanPham %>">25% Sale off - $475</a></h5>
            </div>
            <div class="item">
                <a href="/product_detail.aspx?id=<%= topsplist[1].MaSanPham %>"><img src="<%= topsplist[1].Imglink%>" height="50"></a>
                <h5><a href="/product_detail.aspx?id=<%= topsplist[1].MaSanPham %>">50% Sale off - $250</a></h5>
            </div>
        </div>
        <div id="top_product">
            <h3>Top Products</h3>
            <% foreach (E1_eMart.SanPham sp in topsplist)
               {
            %>
                <div class="item">
                    <a href="/product_detail.aspx?id=<%= sp.MaSanPham %>"><img src=<% =sp.Imglink%> width="50" height="50"></a>
                    <h5><a href="/product_detail.aspx?id=<%= sp.MaSanPham %>"><% =sp.TenSanPham%><br>VND <% =sp.GiaHienTai%></a></h5>
                </div>
            <%
               } 
            %>
        </div>
    </div>
</asp:Content>
